modified: myjupyterlab.sh
[GalaxyCodeBases.git] / etc / whichpm / test / Reports error with non-existing module
blob941eb3f01dd804ccdbb976b2a1cff792d7958b60
1 #!/usr/bin/env bash
3 # ---
4 # IMPORTANT: Use the following statement at the TOP OF EVERY TEST SCRIPT
5 # to ensure that this package's 'bin/' subfolder is added to the path so that
6 # this package's CLIs can be invoked by their mere filename in the rest
7 # of the script.
8 # ---
9 PATH=${PWD%%/test*}/bin:$PATH
11 # Helper function for error reporting.
12 die() { (( $# > 0 )) && echo "ERROR: $*" >&2; exit 1; }
14 dummyModule='Nosuch::Module'
15 errOut=$(whichpm "$dummyModule" 2>&1 1>/dev/null) && die "Unexpectedly didn't fail with dummy module '$dummyModule'."
17 [[ -n $errOut ]] || die "Expected error message, but found none."
19 exit 0